home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / UTILITY1 / MSWSRC35.ZIP / IBMTERM.H < prev    next >
C/C++ Source or Header  |  1992-11-26  |  3KB  |  101 lines

  1. /*
  2.  *      ibmterm.h          IBM-specific graphics macros         mak
  3.  *
  4.  *    Copyright (C) 1989 The Regents of the University of California
  5.  *    This Software may be copied and distributed for educational,
  6.  *    research, and not for profit purposes provided that this
  7.  *    copyright and statement are included in all such copies.
  8.  *
  9.  */
  10.  
  11. #define GR_SIZE 10000
  12.  
  13. #define prepare_to_draw nop()
  14. #define done_drawing nop()
  15.  
  16. #define prepare_to_draw_turtle nop()
  17. #define done_drawing_turtle nop()
  18.  
  19. #define screen_height (screen_bottom - screen_top)
  20. #define screen_width (screen_right - screen_left)
  21.  
  22. #define screen_left (-MaxX/2)
  23. #define screen_right MaxX/2
  24. #define screen_top (-MaxY/2)
  25. #define screen_bottom MaxY/2
  26.  
  27. #define turtle_left_max (-MaxX/2)
  28. #define turtle_right_max MaxX/2
  29. #define turtle_top_max (-MaxY/2)
  30. #define turtle_bottom_max MaxY/2
  31.  
  32. #define turtle_height t_height()
  33. #define turtle_half_bottom t_half_bottom()
  34. #define turtle_side t_side()
  35.  
  36. #define screen_x_coord + turtle_x
  37. #define screen_y_coord - turtle_y
  38.  
  39. #define clear_screen erase_screen()
  40.  
  41. #define line_to(x,y) {if (current_vis==0) ibmto((int)x,(int)-y); else ibmto((int)x,(int)-y);}
  42. #define move_to(x,y) ibmfrom((int)x,(int)-y)
  43. #define draw_string(s) //outtext((char far *)s)
  44. #define set_pen_vis(v) current_vis = v
  45. #define set_pen_mode(m) set_ibm_pen_mode(m)
  46. #define set_pen_color(r,g,b) {if (!in_erase_mode) thepencolor(r,g,b);}
  47. #define set_flood_color(r,g,b) {if (!in_erase_mode) thefloodcolor(r,g,b);}
  48. #define set_screen_color(r,g,b) {if (!in_erase_mode) thescreencolor(r,g,b);}
  49. #define set_pen_width(w) set_ibm_pen_width(w)
  50. #define set_pen_height(h) set_ibm_pen_width(h)
  51. #define set_pen_x(x) ibmto((int)x, -gety())
  52. #define set_pen_y(y) ibmto(getx(), -(int)y)
  53.  
  54. /* pen_info is a stucture type with fields for the various
  55.    pen characteristics including the location, size, color,
  56.    mode (e.g. XOR or COPY), pattern, visibility (0 = visible) */
  57.  
  58. typedef struct { int      h;
  59.                  int      v;
  60.                  int      vis;
  61.                  int      width;
  62.                  int      color, prev_color;
  63.                  unsigned char pattern[8];
  64.                  int      mode; } pen_info;
  65.  
  66. #define p_info_x(p) p.h
  67. #define p_info_y(p) p.v
  68.  
  69. #define pen_width get_ibm_pen_width()
  70. #define pen_height get_ibm_pen_width()
  71. #define pen_color //getcolor()
  72. #define pen_mode get_ibm_pen_mode()
  73. #define pen_vis current_vis
  74. #define pen_x //getx()
  75. #define pen_y //gety()
  76. #define get_node_pen_pattern Get_node_pen_pattern()
  77. #define get_node_pen_mode Get_node_pen_mode()
  78.  
  79. #define pen_reverse ibm_pen_xor()
  80. #define pen_erase ibm_pen_erase()
  81. #define pen_down ibm_pen_down()
  82.  
  83. #define button Button()
  84. #define mouse_x mickey_x()
  85. #define mouse_y mickey_y()
  86.  
  87. #define full_screen nop()
  88. #define split_screen nop()
  89. #define text_screen nop()
  90.  
  91. /* definitions from term.c and math.c for ibmterm.c */
  92. extern int x_coord, y_coord, x_max, y_max, tty_charmode;
  93. /*
  94. extern char so_arr[], se_arr[];
  95. */
  96. extern FLONUM degrad;
  97.  
  98. /* definitions from ibmterm.c for graphics.c */
  99. extern int current_vis, ibm_screen_top, ibm_turtle_top_max;
  100. extern BOOLEAN in_erase_mode;
  101.